<div class="container-fluid" ng-show="detailId=='0'">
  <div class="card card-query">
    <div class="content">
      <div class="row">
        <div class="col-md-6">
          <h4 class="title">任务开始时间</h4>
          <div class="input-daterange input-group form-group">
            <input type="text" class="form-control" ng-model="queryParams.taskCreatedAfter" datetime-picker/>
            <span class="input-group-addon">
              <i class="fa fa-exchange"></i>
            </span>
            <input type="text" class="form-control" ng-model="queryParams.taskCreatedBefore" datetime-picker/>
          </div>
        </div>
        <div class="col-md-6">
          <h4 class="title">流程是否完成</h4>
          <div class="form-group">
            <select class="form-control" ng-model="queryParams.processFinished">
              <option value="">全部</option>
              <option value="true">是</option>
              <option value="false">否</option>
            </select>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-6">
          <h4 class="title">任务完成时间</h4>
          <div class="input-daterange input-group form-group">
            <input type="text" class="form-control" ng-model="queryParams.taskCompletedAfter" datetime-picker/>
            <span class="input-group-addon">
              <i class="fa fa-exchange"></i>
            </span>
            <input type="text" class="form-control" ng-model="queryParams.taskCompletedBefore" datetime-picker/>
          </div>
        </div>

        <div class="col-md-6">
          <h4 class="title">流程定义</h4>
          <div class="input-group form-group">
            <select class="form-control" chosen ng-model="queryParams.processDefinitionId"
                    placeholder-text-single="'选择流程定义'" no-results-text="'没有结果匹配'">
              <option value="">全部</option>
              <option ng-repeat="option in definitions" value="{{option.id}}">{{option.name+' (v'+option.version+')'}}
              </option>
            </select>
            <span class="input-group-btn">
                <button type="button" class="btn btn-info" ng-click="queryTask()">搜索</button>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="card">
    <div class="content">
      <table ng-table="tableOptions" class="table table-striped ng-table">
      </table>
    </div>
  </div>
</div>

<div class="container-fluid" ng-if="detailId!='0'">
  <div class="card card-detail">
    <div class="header">
      <h4 class="title">
        <span class="text-info right-split">{{selectedItem.name}}</span>{{selectedItem.id}}
        <button type="button" class="btn btn-warning pull-right" ng-click="gotoList()">返回列表</button>
      </h4>
    </div>
    <div class="content">
      <div class="row">
        <div class="col-md-12">
          <span class="property"><label>ID:</label>{{selectedItem.id}}</span>
          <span class="property"><label>名称:</label>{{selectedItem.name}}</span>
          <span class="property"><label>描述:</label>{{selectedItem.description}}</span>
          <span class="property"><label>任务标识:</label>{{selectedItem.taskDefinitionKey}}</span>
          <span class="property"><label>表单标识:</label>{{selectedItem.formKey}}</span>
          <span class="property"><label>优先级:</label>{{selectedItem.priority}}</span>
          <span class="property"><label>类别:</label>{{selectedItem.category}}</span>
          <span class="property"><label>父任务:</label>{{selectedItem.parentTaskId}}</span>
          <hr>
          <span class="property"><label>开始时间:</label>{{selectedItem.startTime}}</span>
          <span class="property"><label>认领时间:</label>{{selectedItem.claimTime}}</span>
          <span class="property"><label>结束时间:</label>{{selectedItem.endTime}}</span>
          <span class="property"><label>持续时长:</label>{{selectedItem.durationInMillis/1000}}s</span>
        </div>
      </div>
    </div>
  </div>
  <div class="card card-detail">
    <div class="header">
      <h4 class="title">流程图</h4>
    </div>
    <div class="content">
      <img ng-src="{{getImageUrl(selectedItem.processInstanceId)}}"/>
    </div>
  </div>

  <div class="card card-detail">
    <div class="header">
      <h4 class="title">流程表单</h4>
    </div>
    <div class="content">
      <iframe ng-src="{{getFormUrl(selectedItem.definition,selectedItem.instance)}}" iframe-onload></iframe>
    </div>

  </div>

</div>

